home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / common / headers.h / pipicker.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-24  |  4.0 KB  |  121 lines

  1. /*
  2.     File: PIPicker.h
  3.  
  4.     Copyright (c) 1996, Adobe Systems Incorporated.
  5.     All rights reserved.
  6.  
  7.     This file describes version 1.0 of Photoshop's color picker plug-in module
  8.     interface.
  9. */
  10.  
  11. #ifndef __PIPicker__
  12. #define __PIPicker__
  13.  
  14. #include "PIActions.h"
  15. #include "PIGeneral.h"
  16.  
  17. /********************************************************************************/
  18.  
  19. /* Operation selectors */
  20.  
  21. #define pickerSelectorAbout      0
  22. #define pickerSelectorPick         1
  23.  
  24. /********************************************************************************/
  25.  
  26. /* Error return values. The plug-in module may also return standard Macintosh
  27.    operating system error codes, or report its own errors, in which case it
  28.    can return any positive integer. */
  29.  
  30. #define pickerBadParameters -30800    /* "of a problem with the plug-in module interface" */
  31.  
  32. /********************************************************************************/
  33.  
  34. typedef struct PickParms
  35.     {
  36.     int16 sourceSpace;                // The colorspace the original color is in
  37.     int16 resultSpace;                // The colorspace of the returned result
  38.                                     // Can be plugIncolorServicesChosenSpace
  39.     unsigned16 colorComponents[4];    // Will contain the original color when the
  40.                                     // plugin is called.  The plugin will put
  41.                                     // the returned color here as well.
  42.     Str255 *pickerPrompt;
  43.     }
  44. PickParms;
  45.  
  46. /********************************************************************************/
  47.  
  48. typedef struct PIPickerParams
  49.     {
  50.     
  51.     /* We start with the fields that are common to pretty much all of the plug-ins. */
  52.     
  53.     int32        serialNumber;        /* Host's serial number, to allow
  54.                                        copy protected plug-in modules. */
  55.  
  56.     TestAbortProc    abortProc;        /* The plug-in module may call this no-argument
  57.                                        BOOLEAN function (using Pascal calling
  58.                                        conventions) several times a second during long
  59.                                        operations to allow the user to abort the operation.
  60.                                        If it returns TRUE, the operation should be aborted
  61.                                        (and a positive error code returned). */
  62.  
  63.     ProgressProc    progressProc;    /* The plug-in module may call this two-argument
  64.                                        procedure periodically to update a progress
  65.                                        indicator.  The first parameter is the number
  66.                                        of operations completed; the second is the total
  67.                                        number of operations. */
  68.  
  69.     OSType        hostSig;            /* Creator code for host application */
  70.     HostProc    hostProc;            /* Host specific callback procedure */
  71.  
  72.     BufferProcs *bufferProcs;        /* The host buffer procedures. */
  73.     
  74.     ResourceProcs *resourceProcs;    /* The host plug-in resource procedures. */
  75.     
  76.     ProcessEventProc processEvent;    /* Pass event to the application. */
  77.     
  78.     DisplayPixelsProc displayPixels;/* Display dithered pixels. */
  79.  
  80.     HandleProcs    *handleProcs;        /* Platform independent handle manipulation. */
  81.  
  82.     ColorServicesProc colorServices; /* Routine to access color services. */
  83.     
  84.     ImageServicesProcs *imageServicesProcs;
  85.                                     /* Suite of image processing callbacks. */
  86.             
  87.     PropertyProcs    *propertyProcs;    /*    Routines to query and set document and
  88.                                         view properties. The plug-in needs to
  89.                                         dispose of the handle returned for
  90.                                         complex properties (the plug-in also
  91.                                         maintains ownership of handles for
  92.                                         set properties.
  93.                                     */
  94.                                     
  95.     ChannelPortProcs *channelPortProcs;
  96.                                     /* Suite for passing pixels through channel ports. */
  97.             
  98.     PIDescriptorParameters    *descriptorParameters;    /* For recording and playback */
  99.     Str255                    *errorString;            /* For silent and errReportString */
  100.     
  101.     PlugInMonitor    monitor;        /* Information on current monitor */
  102.  
  103.     void         *platformData;        /* Platform specific information. */
  104.  
  105.     char reserved [4];                /* 4 bytes of reserved space. */
  106.  
  107.     /* We follow this with the fields specific to this type of plug-in. */
  108.  
  109.     PickParms pickParms;
  110.     
  111.     /* And, of course, space for future expansion. */
  112.     
  113.     char reservedBlock [260];
  114.             
  115.     }
  116. PIPickerParams, *PickerRecordPtr;
  117.  
  118. /********************************************************************************/
  119.  
  120. #endif /* __PIPicker__ */
  121.